<template>
  <div class="h5-wrapper">
    <div class="content">
      <router-view></router-view>
    </div>
    <nav class="tabbar">
    <router-link to="/article">面经</router-link>
    <router-link to="/collect">收藏</router-link>
    <router-link to="/like">喜欢</router-link>
    <router-link to="/user">我的</router-link>
  </nav>
  </div>
 
</template>

<script>
export default {
name:'LayoutPage',
created(){
  console.log('created 组件被加载了');
},
mounted(){
  console.log('组件被渲染了');
},
destroyed(){
  console.log('组件被销毁了');
},
activated(){
  alert('欢迎回到首页')
  console.log('activated组件被激活了，看到页面');
},
deactivated(){
  console.log('deactivated组件失活，离开页面');
}

}
</script>

<style>
body {
  margin: 0;
  padding: 0;
}
</style>
<style  scoped>  
.h5-wrapper .content{
  margin-bottom: 51px;
}
.h5-wrapper .tabbar {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 50px;
    line-height: 50px;
    text-align: center;
    display: flex;
    background: #fff;
    border-top: 1px solid #e4e4e4;
}
.h5-wrapper .tabbar a {
      flex: 1;
      text-decoration: none;
      font-size: 14px;
      color: #333;
      -webkit-tap-highlight-color: transparent;
    }
 .h5-wrapper .tabbar a.router-link-active{
      color:orange
    }
</style>